#include <iostream>//main.cpp
#include <stdlib.h>
#include "intArray.cpp"

using namespace std;

int main()
{
    intArray a(10);
    cin>>a;
    cout<<a;
    intArray b=a;
    cout<<"the array b: "<<endl<<b;
    int arr[5],counter=0;
    for(int i=1;i<10;i+=2)
    {
        if(b.Get(i,arr[counter]))
            counter++;
        else{
            cout<<"There is something wrong when getting numbers!!"<<endl;
            exit(0);
        }
    }
    counter=0;
    cout<<"the array that we get: ";
    for(int i=0; i<5;i++)
    {
        cout<<arr[i]<<" ";
    }
    cout<<endl;
    for(int i=1;i<10;i+=2)
    {
        if(b.Set(i,arr[counter]*2))
            counter++;
        else
        {
            cout<<"There is something wrong when setting numbers!!!"<<endl;
            exit(0);
        }
    }
    cout<<b;
    intArray c(5);
    cin>>c;
    cout<<c;
    c.ReSize(10);
    c=a;
    cout<<"the array c:"<<endl<<c;
    intArray d=b+c;
    intArray e=b-c;
    cout<<"the array d: "<<endl<<d<<"the array e:"<<endl<<e;

    return 0;
}
